/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.medirem.logic;

import be.ugent.medirem.persistence.entity.details.PrescriptionDetails;
import be.ugent.medirem.persistence.entity.values.PrescriptionValues;
import be.ugent.medirem.persistence.exception.EntityNotFoundException;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.ejb.Remote;

/**
 *
 * @author Thomas Roelens
 */
@Remote
public interface PrescriptionRemote {

    @RolesAllowed("gp")
    void prescribeMedication(Long patientId, PrescriptionValues prescription);

    @RolesAllowed({"gp", "patient"})
    List<PrescriptionDetails> getPrescriptions(Long patientId);

    @RolesAllowed("gp")
    void removePrescriptionFromPatient(Long patientId, Long prescriptionId);

    @RolesAllowed("gp")
    void removePrescription(Long id) throws EntityNotFoundException, IllegalArgumentException;

    @RolesAllowed({"gp", "patient"})
    PrescriptionDetails getPrescriptionDetails(Long prescriptionId) throws EntityNotFoundException, IllegalArgumentException;
}
